<template>
  <el-card :id="company_id" class="box-card" style="cursor:pointer;margin-bottom: 20px;">
    <el-row style="height: 100%;">
      <el-col :span="1"><div class="grid-content "></div></el-col>
      <el-col :span="23"><div class="grid-content " style="height: 30px;"  @click="goto_detail">
        <div class="box-header-style">
          <el-row>
            <el-col :span="20">
              <p class="title-style">{{title}}</p>
            </el-col>
            <el-col :span="4">
              <el-image :src="img_src" style="width: 25px;height: 25px;"></el-image>
            </el-col>
          </el-row>
        </div>
      </div></el-col>
      <el-divider style="margin: 10px;"></el-divider>
      <p class="text-style" style="padding-left: 7px;">{{company_address}}
        <el-divider direction="vertical"></el-divider>{{company_style}}
        <el-divider direction="vertical"></el-divider><el-link type="success" :href="company_years" target="_blank">{{company_years}}</el-link></p>
    </el-row>
  </el-card>
</template>

<script>
export default {
  name: 'CompanyCard',
  data(){
    return{
      // title:"标题",
      // company_address:"公司地址",
      //company_style:"公司类型",
      //company_years:"公司成立时间"
      // img_src:require('@/assets/test1.jpg'),
      //company_id:"公司编号"
    }
  },
  props:["title","company_address","company_style","company_years","img_src","company_id"],
  methods:{
    goto_detail(){


      if (localStorage.getItem('Token')) {
        sessionStorage.setItem("YHDetail_company_id",this.company_id)
        sessionStorage.setItem("YHDetail_company_title",this.title)
        this.$router.push('/DetailCompany')

      }
      else {
        this.$router.push('/weblogin')
      }
    },
  }
}
</script>

<style scoped>
.box-card{
  height: 125px;
  border-style:solid;
  border-width:4px;
  border-color: #ffffff;
}
.box-header-style{
  margin: 0;
  height: 30px;
}
.title-style{
  margin: 0;
  font-family:"微软雅黑";
  font-size: 20px;
}
.money-style{
  margin: 0;
  font-family:"黑体";
  font-size: 16px;
  color: #fc771d;
}

.text-style{
  color: #a8a8a8;
  margin: 0;
  font-family:"微软雅黑";
  font-size: 13px;
  width: 100%;
  height: 15px;
}
.box-card:Hover {
  border-color: #A5D6A7;
}
</style>
